package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.PriceSchemeActivateType;
import com.ticket.sass.common.entity.tenant.enums.PriceSchemeAvailablePeriod;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-03-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("price_schemes")
@ApiModel(value="PriceSchemesEntity对象")
public class PriceSchemeEntity implements Serializable {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "方案名称")
    private String title;
    
    @ApiModelProperty(value = "生效类型：0 不限 1 指定")
    private PriceSchemeActivateType activateType;

    @ApiModelProperty(value = "有效日期开始")
    private LocalDate startDate;

    @ApiModelProperty(value = "有效日期结束")
    private LocalDate endDate;
    
    @ApiModelProperty(value = "售价")
    private BigDecimal salePrice;
    
    @ApiModelProperty(value = "发行价")
    private String issuePrices;
    
    @ApiModelProperty(value = "可用时段：0 不限制， 1 指定范围")
    private PriceSchemeAvailablePeriod availablePeriod;
    
    @ApiModelProperty(value = "是否启用")
    private Boolean enable;
    
    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;

    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;

    @TableField(exist = false)
    private List<PriceSchemeWeekEntity> priceSchemeWeeks;

    @TableField(exist = false)
    private List<PriceSchemeMemberPriceEntity> priceSchemeMemberPrices;

    @TableField(exist = false)
    private List<PriceSchemeFilmMapEntity> priceSchemeFilmMaps;

    @TableField(exist = false)
    private List<PriceSchemeHallMapEntity> priceSchemeHallMaps;
}

